﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.OleDb;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string degergoster =  Request.QueryString["sayfa"];
        if (degergoster == "kasko")
        {

            MultiView1.ActiveViewIndex = 0;
        }
        if (degergoster == "saglik")
        {

            MultiView1.ActiveViewIndex =1;
        }
 if (degergoster == "konut")
        {

            MultiView1.ActiveViewIndex = 2;
        }

 if (degergoster == "sil")
 {

     MultiView1.ActiveViewIndex = 3;
 }
    }
    protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
    {

    }
    protected void FormView1_ItemInserting1(object sender, FormViewInsertEventArgs e)
    {

    }
    protected void LinkButton2_Click(object sender, EventArgs e)
    {
       
        OleDbConnection con = new OleDbConnection(ConfigurationManager.ConnectionStrings["acsbagla"].ConnectionString);

        if (con.State == ConnectionState.Closed)
        {
            con.Open();
        }
        OleDbCommand komutsec = new OleDbCommand("DELETE from tblmusteri where userid="+Session.Contents["UID"].ToString(), con);
      
        komutsec.ExecuteNonQuery();
        con.Close();
        Response.Redirect("sayfagoster.aspx?sayfa=sil");
        Response.End();
    }
    protected void LinkButton2_Click1(object sender, EventArgs e)
    {
       LinkButton2_Click(sender, e);

    }
    protected void LinkButton2_Click2(object sender, EventArgs e)
    {
        LinkButton2_Click(sender, e);
    }
}
